import request from '@/utils/request'

// 注册
export default {
  // 获取图形验证码
  getGraphicCaptcha(account) {
    return request({
      url: `/captcha/graphic/get?account=${account}&time=${Date.now()}`,
      method: 'get',
    })
  },
  // 检查图形验证码
  checkGraphicCaptcha(account,captcha) {
    return request({
      url: `/captcha/graphic/verify?account=${account}&captcha=${captcha}`,
      method: 'get'
    })
  },
  // 发送手机短信验证码
  sendSmsCaptcha(account,captcha) {
    return request({
      url: `/captcha/sms/send?phone=${account}&captcha=${captcha}`,
      method: 'get'
    })
  },
  // 验证手机短信验证码
  checkSmsCaptcha(account,captcha) {
    return request({
      url: `/captcha/sms/verify?phone=${account}&captcha=${captcha}`,
      method: 'get'
    })
  },
  //  发送电子邮箱验证码
  sendEmailCaptcha(account, captcha) {
    return request({
      url: `/captcha/mail/send?email=${account}&captcha=${captcha}`,
      method: 'get'
    })
  },
  // 验证电子邮箱
  checkEmailCaptcha(account,captcha) {
    return request({
      url: `/captcha/mail/verify?email=${account}&captcha=${captcha}`,
      method: 'get'
    })
  }

}